package repository

import (
	"github.com/RaymondCode/simple-demo/entity/po"
	"gorm.io/gorm"
)

type User interface {
	// Insert 插入一条用户数据
	Insert(tx *gorm.DB, isTx bool, user *po.User) (int, error)
	// QueryById 根据ID查询用户数据
	QueryById(userId int) (*po.User, error)
	// QueryBatchByIds 根据ID批量查询用户数据
	QueryBatchByIds(userIds *[]int) (*[]po.User, error)
	// QueryByCondition 条件查询
	QueryByCondition(user *po.User) (*[]po.User, error)
	// QueryFollows 查询关注列表(时间倒序)
	QueryFollows(userId int) (*[]po.User, error)
	// QueryFans 查询粉丝列表(时间倒序)
	QueryFans(userId int) (*[]po.User, error)
	// ChangeFollowCount 修改关注数量
	ChangeFollowCount(userId, difference int, tx *gorm.DB, isTx bool) error
	// ChangeFansCount 修改粉丝数量
	ChangeFansCount(userId, difference int, tx *gorm.DB, isTx bool) error
}
